package cn.zyy.controller;

import cn.zyy.entity.Student;
import cn.zyy.service.StudentService;
import cn.zyy.service.StudentServiceImpl;

import java.util.HashMap;

public class StudentController {
    private StudentService studentService = new StudentServiceImpl();
    //添加学生
    public Boolean addStudent(Student student){
        return studentService.addStudent(student);
    }
    //根据id删除学生
    public Boolean deleteStudent(int id) {
        return studentService.deleteStudent(id);
    }
    //根据学生id和班级名称给学生分班（根据班级名称查询班级ID，然后根据学生id，更新学生的班级信息）
    public Integer classification(String className) {
        return studentService.classification(className);
    }
    public Boolean classification(int stuId, Integer classId) {
        return studentService.classification(stuId,classId);
    }
    //查询所有学生信息，要求显示对应班级名称
    public HashMap<String,String> selectStudent() {
        return studentService.selectStudent();
    }
}
